{extend name="./oscshop/admin/view/public/base.html" /}
{block name="content"}
<div class="page-header">		
		<h1>	
			移动端
			<small>
				<i class="ace-icon fa fa-angle-double-right"></i>
				{$breadcrumb1}
			</small>
			<small>
				<i class="ace-icon fa fa-angle-double-right"></i>
				编辑
			</small>
		</h1>
	</div>
<div class="row">
	<div class="col-xs-12">	
		<div class="form-horizontal">
				
			<input name="agent_id" type="hidden" value="{$Request.param.id}" />
			
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-left"> 姓名</label>
			<div class="col-sm-10">
				<div class="clearfix">					
						<input class="form-control" name="name" type="text" value="{$agent.name}" /> 			
				</div>
			</div>
			</div>
			<div class="space-4"></div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-left"> 电话</label>
			<div class="col-sm-10">
				<div class="clearfix">					
						<input class="form-control" name="tel" type="text"  value="{$agent.tel}"  /> 			
				</div>
			</div>
			</div>
			<div class="space-4"></div>
			
			
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-left"> * 代理级别 </label>
			<div class="col-sm-10">
				<div class="clearfix">
					<select  class="form-control" name="agent_level">
						{volist name="level" id="v"}							
							<option value="{$v.al_id}" {if condition="isset($agent)&&($v['al_id'] eq $agent['agent_level'])"}selected="selected"{/if}  >{$v.name}</option>								
						{/volist}
					</select>
				</div>
			</div>
			</div>
			<div class="space-4"></div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-left"> 状态</label>
			<div class="col-sm-10">
				<div class="clearfix">
					<label class="radio-inline">
						<input name="status" type="radio" checked="checked" value="1" /> 开启
					</label>
					<label class="radio-inline">
						<input name="status" type="radio" value="0"  /> 关闭
					</label>
				</div>
			</div>
			</div>
			<div class="space-4"></div>
			
			<div class="form-group">
				<label class="col-sm-1 control-label no-padding-left"> </label>	
				<div class="col-sm-11">
					<input id="send" type="submit" value="提交" class="btn btn-primary" />
				</div>
			</div>
			
		</div>
	</div>
</div>

{/block}
{block name="javascript"}
<script>
$(function(){	
	Oscshop.setValue("status", {$agent.status|default=1});	
	
	var back_index="{:url('AgentBackend/agent_list')}";
	
	$('#send').click(function(){
		$.post(
			"{:url('AgentBackend/edit_agent')}",
			$('.form-horizontal input[type=\'text\'],.form-horizontal input[type=\'hidden\'],.form-horizontal select'),
			function(d){
				art_dialog(d,back_index);
			}
		);
	});	
	
});	
</script>	
{/block}